﻿using ArchivingDataModel;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ArchivingDataWebForms.MasterPages
{
    public partial class PrimaryMaster : System.Web.UI.Masterpage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Session["LabelLoginName"] != null)
            {
                this.LabelLoginName.Text = this.Session["LabelLoginName"].ToString();
            }
            else if (this.Page.User.Identity.Name!="")
            {
                using (ArchivingDataEntities ent = new ArchivingDataEntities())
                {
                    string userID = Membership.GetUser(this.Page.User.Identity.Name).ProviderUserKey.ToString();
                    var employee = ent.Employees.Include("Organization").FirstOrDefault(i => i.User_ID == userID);
                    this.Session["LabelLoginName"] = employee.Organization.Organization_Name_AR + " : " + employee.Employee_NameAR;
                }
            }
        }

        protected void RadColorPickerDefault_ColorChanged(object sender, EventArgs e)
        {
            //this.divBackgroundColor.Style["background-color"] = ColorTranslator.ToHtml(this.RadColorPickerDefault.SelectedColor);
        }

    }
}